package com.lm.ehcache.service;


import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;


@Service
public class UserService {
    @Cacheable(value = "myCache", key = "#id")
    public String getUserById(String id) {
        System.out.println("查询数据库...");
        return "User-" + id;
    }
}